<div id="container" class="clear">
	<div id="left">
		<h2><?php echo $h2; ?></h2>
		<!--{{{-->
		<ul class="mb10 mt10">
			<?php foreach($codes as $code){ ?>
			<li class="bdotted pb10 mb10">
			<p class="fwb"><a href="<?php echo url::site('code/detail/'.$code->id); ?>"><?php echo $code->title;?></a></p>
			<p class="fr fs12"><?php echo date::get_latest_timespan(date::timespan($code->pubdate)); ?></p>
			<p class="fs12 gray"><?php echo '<a href="'.url::site('code/lan/'.$code->lan).'">'.$code->lan.'</a>';$cmtNum = $code->comments->count(); echo ' | '.$cmtNum.'条评论';$fav = $code->users->count(); echo ' | '.$fav.'人收藏'; ?> </p>
			</li>
			<?php } ?>
		</ul>
		<!--}}}-->
		<div class="fr mb10 fs12">
<?php echo $pageNation; ?>
		</div>
	</div>

	<div id="right">
		<div class="mb20">
		<div class="clear mb20"><img class="fl" width="36" height="36" src="<?php echo gravatar::get($user['email'],36); ?>" />
		<?php if(Session::instance()->get('userId') != $user['id']){ ?>
		<p class="pt10 ml10 fl" id="follow"><a href="#" class="follow">
			<?php  if($follow=='add') echo '关注'.$user['username']; else echo '取消关注';?></a>
		</p>
		<?php } ?>
			</div>
			<div class="clear fs12">
			<p class="bdotted pb5 mb10 fs14"><?php echo $user['username']; ?>的信息</p>
				<p class="mb5"><a href="<?php echo url::site('user/view/'.$user['id']); ?>">已发代码(<?php echo $codeNum; ?>)</a></p>
				<p class="mb5"><a href="<?php echo url::site('user/viewfav/'.$user['id']); ?>">收藏(<?php echo $favNum; ?>)</a></p>
				<?php if(!empty($user['blogurl'])){echo '<p class="mt5">博客：<a href="'.$user['blogurl'].'" target="_blank">'.$user['blogname'].'</a></p>';} ?>
			</div>
		</div>
		<div class="clear">
		<?php if(!empty($following)){ ?> 
		<p class="bdotted pb5 mb10 fs14"><?php echo $user['username']; ?>关注这些人</p>
		<ul class="flli clear mb20">
			<?php foreach($following as $follower){ ?>
			<li class="pr5"><a href="<?php echo url::site('user/view/'.$follower->id); ?>"><img title="<?php echo $follower->username; ?>" src="<?php echo gravatar::get($follower->email); ?>" /></a></li>
			<?php } ?>
		</ul>
		<?php } ?>
		</div>

		<div class="clear">
		<?php if(!empty($beingfollowed)){ ?> 
		<p class="bdotted pb5 mb10 fs14">这些人关注<?php echo $user['username']; ?></p>
		<ul class="flli clear mb20">
			<?php foreach($beingfollowed as $follower){ ?>
			<li class="pr5"><a href="<?php echo url::site('user/view/'.$follower->id); ?>"><img title="<?php echo $follower->username; ?>" src="<?php echo gravatar::get($follower->email); ?>" /></a></li>
			<?php } ?>
		</ul>
		<?php } ?>
		</div>
		
	</div>
	
</div>
<script type="text/javascript">
$('#follow').data('user_id',<?php echo $user['id']; ?>);
$('#follow').data('addFollow','<a href="#" class="follow">关注<?php echo $user['username'];?></a>');
$('#follow').data('removeFollow','<a href="#" class="follow">取消关注</a>');
$('#follow').data('loading','<?php echo url::base();?>media/img/loading.gif');
$('#follow').data('ajaxUrl','<?php echo url::site('user/follow/'.$user['id']); ?>')
</script>
